<template>
  <div>
    <div style="padding: 5px 10px;">
      <table class="bs-table">
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">文号</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{planningFormData.releaseNo}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">规划名称</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{planningFormData.title}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">规划类型</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.category,PROJECT_DIC.CATEGORY)}}</span>
          </td>
          <th class="bs-table_th" style="width: 200px">规划期限</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{dealStartEndDate(planningFormData.startDate,planningFormData.endDate)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">申报(牵头)单位</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{planningFormData.orgName}}</span>
          </td>
          <th class="bs-table_th" style="width: 200px">规划等级</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.planningRank,PROJECT_DIC.PLANNING_RANK)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">发布时间</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.releaseDate,null,'date')}}</span>
          </td>
          <th class="bs-table_th" style="width: 200px">发布层级</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.planningLevel,PROJECT_DIC.PLANNING_LEVEL)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">审批机关级别</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.approvingAuthorityLevel,PROJECT_DIC.APPROVING_AUTHORITY_LEVEL)}}</span>
          </td>
          <th class="bs-table_th" style="width: 200px">审批机关性质</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.approvingAuthorityNature,PROJECT_DIC.APPROVING_AUTHORITY_NATURE)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">联系人姓名</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{planningFormData.contactName}}</span>
          </td>
          <th class="bs-table_th" style="width: 200px">联系电话</th>
          <td class="bs-table_td">
            <span style="vertical-align: bottom">{{planningFormData.contactNumber}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">编制经费来源</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{planningFormData.financialSource}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">立项依据</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.basis)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">立项依据附件</th>
          <td class="bs-table_td" colspan="3">
            <preview :attachementId="planningFormData.basisFileId" v-if="planningFormData.basisFileId"></preview>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">主要内容</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.content)}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">规划文本</th>
          <td class="bs-table_td" colspan="3">
            <preview :attachementId="planningFormData.textId" v-if="planningFormData.textId"></preview>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">相关材料</th>
          <td class="bs-table_td" colspan="3">
            <div>
              <div v-for="fileid in planningFormData.relateFiles" :key="fileid">
                <preview :attachementId="fileid" v-if="fileid"></preview>
              </div>
            </div>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">是否公开</th>
          <td class="bs-table_td" colspan="3">
            <span style="vertical-align: bottom">{{getNotNull(planningFormData.isOpen,PROJECT_DIC.isOpen,'isOpen')}}</span>
          </td>
        </tr>
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 200px">规划文本（部分公开）</th>
          <td class="bs-table_td" colspan="3">
            <div>
              <preview :attachementId="planningFormData.halfOpenTextId" v-if="planningFormData.halfOpenTextId"></preview>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
  import {getNotNull,dealStartEndDate} from '@/views/util'
  import {PROJECT_DIC} from '@/const/dict'

    export default {
        name: "submitValidate",
        props: {
          planningFormData: {
            type: Object,
          },
        },
        created(){
          this.planningFormData.textId = Number(this.planningFormData.textId);
          this.planningFormData.basisFileId = Number(this.planningFormData.basisFileId);
          this.planningFormData.halfOpenTextId = Number(this.planningFormData.halfOpenTextId)
        },
        data(){
          return{
            PROJECT_DIC:PROJECT_DIC
          }
        },
      methods:{
        getNotNull(val,dic,type){
         var result =  getNotNull(val,dic,type);
         return result;
        },
        dealStartEndDate(startDate,endDate){
          dealStartEndDate(startDate,endDate);
        }
      },
    }
</script>

<style scoped>

</style>
